<html>
<head>

<!-- Include your JS library of choice here and fix the path
 
    <script src="javascripts/prototype.js" type="text/javascript"></script>
    <script src="javascripts/jquery/jquery-1.2.6.min.js" type="text/javascript"></script>
 
--->
 
<!-- I am using jQuery --->
<script src="Javascripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
 
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "300", "300", "9.0.0", "expressInstall.swf", {"data-file":"data.php?val=13"} );
 
</script>
 
<script type="text/javascript">
 
OFC = {};
 
OFC.jquery = {
    name: "jQuery",
    version: function(src) { return $('#'+ src)[0].get_version() },
    rasterize: function (src, dst) { $('#'+ dst).replaceWith(OFC.jquery.image(src)) },
    image: function(src) { return "<img src='data:image/png;base64," + $('#'+src)[0].get_img_binary() + "' />"},
    popup: function(src) {
        var img_win = window.open('', 'Charts: Export as Image')
        with(img_win.document) {
            write('<html><head><title>Gr&aacute;fico como Imagen<\/title><\/head><body>' + OFC.jquery.image(src) + '<BR>Haga click derecho sobre la imagen y de guardar como.<\/body><\/html>') }
		// stop the 'loading...' message
		img_win.document.close();
     }
}
 
// Using an object as namespaces is JS Best Practice. I like the Control.XXX style.
//if (!Control) {var Control = {}}
//if (typeof(Control == "undefined")) {var Control = {}}
if (typeof(Control == "undefined")) {var Control = {OFC: OFC.jquery}}
 
 
// By default, right-clicking on OFC and choosing "save image locally" calls this function.
// You are free to change the code in OFC and call my wrapper (Control.OFC.your_favorite_save_method)
// function save_image() { alert(1); Control.OFC.popup('my_chart') }
function save_image() { Control.OFC.jquery; OFC.jquery.popup('my_chart') }
function moo() { alert(99); };

</script>
 
</head>
<body>
 
<p>Hello World</p>
 
 
<div id="my_chart"></div>
 
<p>Don't forget to "view source"</p>
 
</body>
</html>